/****
 * 系统主题
 */

/* 设置全局字体为思源宋体 */
body, html {
  font-family: 'Heiti SC', sans-serif;
  font-weight: lighter;
}

/* 亮 主题样式 */
.light-theme {
  /* 背景样式 */
  .theme-bg {
    background-color: #fff;
    color: #333;
  }
  /* 用户和机器人对话卡字体颜色 输入框 */
  --chat-card-font-color: black;
  /* 布局背景 */
  --layout-common-layout-bg: #eee;
  /* 输入框背景 与 theme-bg一致 */
  --send-box-search-input-bg: #fff;
  /* 输入框模糊背景样式切换 */
  --send-box-search-input-before: none;

  --chat-input-placeholder-color:grey;
}

/* 暗黑 主题样式 */
.dark-theme {
  /* 背景样式 */
  .theme-bg {
    background-color: #333;
    color: #fff;
  }
  /* 用户和机器人对话卡字体颜色 */
  --chat-card-font-color: white;
  /* 布局背景 */
  --layout-common-layout-bg: black;
  /* 输入框背景 与 theme-bg一致 */
  --send-box-search-input-bg: #333;
  /* 输入框模糊背景样式切换 */
  --send-box-search-input-before: none;

  --chat-input-placeholder-color:grey;
}

/* 毛玻璃 主题样式 */
.glass-theme {
  /* 背景样式 */
  .theme-bg {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #333;
    background-size: cover;
  }
  --chat-input-placeholder-color:grey;
  /* 用户和机器人对话卡字体颜色 */
  --chat-card-font-color: black;
  /* 布局背景 */
  --layout-common-layout-bg: url('../images/bg_4.jpg') no-repeat center center;
  /* 输入框背景 与 theme-bg一致 */
  --send-box-search-input-bg: none;
  /* 输入框模糊背景样式切换 */
  --send-box-search-input-before: blur(20px);
}

.tech-theme {
  /* ===== 全局聊天消息样式 ===== */
  .chat-container {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
  }
  .welcome-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    
    /* 深蓝透明玻璃面板（与背景融合） */
    background: rgba(20, 40, 80, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* 中国红+科技蓝的渐变边框 */
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, 
        rgba(207, 32, 39, 0.8) 0%,  /* 中国红 */
        rgba(0, 150, 255, 0.6) 100%  /* 科技蓝 */
    ) 1;
    
    border-radius: 8px;
    
    /* 发光阴影效果 */
    box-shadow: 
        0 0 15px rgba(0, 100, 255, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.1);
    
    /* 文字样式 */
    color: #e0f2ff;
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    
    /* 动态元素 */
    position: relative;
    overflow: hidden;
}

/* 中国风装饰线（顶部） */
.welcome-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(207, 32, 39, 0.8),  /* 中国红 */
        transparent
    );
}

/* 科技感光流动画 */
.welcome-container::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 30%;
    height: 200%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 150, 255, 0.1),
        transparent
    );
    transform: rotate(30deg);
    animation: techFlow 6s infinite;
}

@keyframes techFlow {
    100% {
        left: 150%;
        top: 100%;
    }
}

/* 输入提示样式 */
.welcome-container input::placeholder {
    color: rgba(200, 220, 255, 0.6);
    font-style: italic;
}
  .message {
    display: flex;
    margin-bottom: 16px;
    max-width: 80%;
    
    .avatar-wrapper {
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      margin: 0 8px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--tech-primary), #3a94f4);
      padding: 3px;
      display: flex;
      justify-content: center;
      align-items: center;
      box-shadow: var(--tech-glow);
      order: -1;

      .avatar {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: var(--tech-bg-dark);
      }
    }

    .message-content {
      display: flex;
      flex-direction: column;
    }

    .message-bubble {
      color: var(--chat-card-font-color);
      padding: 10px 15px;
      border-radius: 4px;
      position: relative;
      line-height: 1.5;
      font-size: 14px;
      word-wrap: break-word;
      white-space: pre-wrap;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--tech-primary), transparent);
      }

      &::after {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        border: 2px solid var(--tech-primary);
      }
    }
  }

  /* ===== 用户消息样式 ===== */
  .user-message {
    margin-left: auto;
    flex-direction: row-reverse;

    .message-bubble {
      background: linear-gradient(135deg, rgba(58, 148, 244, 0.8), rgba(18, 94, 171, 0.9));
      border-top-right-radius: 0;

      &::after {
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: none;
      }
    }
  }

  /* ===== AI消息样式 ===== */
  .bot-message {
    margin-right: auto;

    .message-bubble {
      background: linear-gradient(135deg, rgba(22, 68, 124, 0.8), rgba(10, 46, 90, 0.9));
      border-top-left-radius: 0;

      &::after {
        bottom: 0;
        right: 0;
        border-left: none;
        border-top: none;
      }
    }
  }

  /* ===== 消息底部样式 ===== */
  .message-footer {
    display: flex;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: #999;

    .stats {
      margin-right: 10px;
    }

    .copy-icon {
      margin-left: 8px;
      cursor: pointer;
      color: #999;

      &:hover {
        color: #666;
      }
    }

    .regenerate-btn {
      margin-left: 10px;
      background: transparent;
      border-color: #ddd;
      color: #666;
      padding: 3px 8px;

      &:hover {
        background: #f5f5f5;
      }
    }
  }

  /* ===== Markdown预览样式 ===== */
  :deep(.v-md-editor-preview) {
    background: transparent !important;
  }

  :deep(.vuepress-markdown-body) {
    background: transparent !important;
    padding: 0 !important;
    font-size: 14px !important;
    color: var(--chat-card-font-color) !important;
  }
  
  :deep(pre) {
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 4px;
  }

  /* ===== 响应式设计 ===== */
  @media (max-width: 768px) {
    .message {
      max-width: 90%;
    }
  }

  /* ===== 主题变量 ===== */
  --tech-primary: #01ffff;
  --tech-bg-dark: #0a1a2e;
  --tech-bg-light: rgba(22, 68, 124, 0.3);
  --tech-border: rgba(31, 159, 191, 0.8);
  --tech-glow: 0 0 10px rgba(1, 255, 255, 0.5);
  --chat-card-font-color: rgb(255, 255, 255);
  --layout-common-layout-bg: url('../images/bg.png') no-repeat center center;
  --send-box-search-input-bg: none;
  --send-box-search-input-before: blur(20px);
  --chat-input-placeholder-color:rgba(255, 255, 255, 0.6);
  /* 背景样式 */
  .theme-bg {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    background-size: cover;
  }

  .chat-input-container::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: rgba(22, 68, 124, 0.8) transparent;
  }
  
  .chat-input-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      to bottom right,
      rgba(1, 255, 255, 0) 0%,
      rgba(1, 255, 255, 0.1) 50%,
      rgba(1, 255, 255, 0) 100%
    );
    animation: shine 3s infinite;
  }
  @keyframes shine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  
  .chat-input :deep(.el-textarea__inner) {
    background: rgba(22, 68, 124, 0.5);
    border: 1px solid rgba(31, 159, 191, 0.8);
    border-radius: 12px;
    color: #ffffff;
    padding: 12px 15px;
    box-shadow: none;
    transition: all 0.3s;
    min-height: 40px !important;
    line-height: 1.5;
  }
  
  .chat-input :deep(.el-textarea__inner):focus {
    border-color: #01ffff;
    box-shadow: 0 0 8px rgba(1, 255, 255, 0.4);
  }
  
  .chat-input :deep(.el-textarea__inner)::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }
}

.el-row {
  margin-bottom: 20px;
}

.el-row:last-child {
  margin-bottom: 0;
}

.el-col {
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.ground-glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 如果浏览器不支持 backdrop-filter，则可以提供一个替代方案 */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .ground-glass {
    background: white;
  }
}

.dashed-border-right {
  border-right: 1px dashed grey;
}

.dashed-border-left {
  border-left: 1px dashed grey;
}

.dashed-border-top {
  border-top: 1px dashed grey;
}

.dashed-border-bottom {
  border-bottom: 1px dashed grey;
}

.dashed-border {
  border: 1px dashed grey;
}
